home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Bases de données / Roberto's Package Last Version / Dossier Éditer les scripts 2.0 / Éditer les scripts 2.1.'Scpt < prev    next >
Text File  |  1995-10-01  |  11KB  |  344 lines

  1. 12:36 ╤ Dimanche 1 Octobre 1995
  2. ╫ Document rÄalisÄ avec ╟ âditer les scripts ╚ - Version 2.1.2 par Roberto Minotti & Jean Patrick Wendt. ╫
  3.  
  4. Pour une parfaite lisibilitÄ de ce document, utilisez la police Monaco 9 points.
  5.  
  6. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ SCRIPT DE PILE ╟ âditer les scripts 2.1.2 ╚Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ
  7. on startup
  8.   AddColor install
  9.   colorMe
  10. end startup
  11. on openCard
  12.   Send colorMe to this card
  13.   pass openCard
  14. end openCard
  15. on closeCard
  16.   lock screen
  17.   pass closeCard
  18. end closeCard
  19. on colorMe
  20.   AddColor colorCard,stamp,30
  21. end colorMe
  22. on openStack
  23.   AddColor install
  24.   put "╦ propos d'âditer les scripts..." into menuitem 1 of menu 1
  25.   set userlevel to 5
  26.   set cantmodify of this stack to true
  27.   AddColor install
  28.   answer "╦ votre place, avant de commencer, je lirai le document ╟ âditer les scripts - Lisez-moi ╚." with "T'occupes"
  29.   pass openStack
  30. end openStack
  31. on closeStack
  32.   AddColor remove
  33.   pass closeStack
  34. end closeStack
  35. on idle
  36.   hide Msg
  37.   pass idle
  38. end idle
  39.  
  40. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ FOND 1 ╟bkgnd id 2598╚ Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ
  41.  
  42. ╫╫ Objet(s) dans FOND 1 sans script : ╫ FOND ╟bkgnd id 2598╚╫
  43.  
  44. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ CARTE 1 ╟un╚ Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ
  45. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ LES CHAMPS DE CARTE
  46.  
  47. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ LES BOUTONS DE CARTE
  48. Ñ-Ñ-Ñ-Ñ BOUTON 1 : ╟Bonus╚
  49. on mouseUp
  50.   if the optionkey is down then
  51.     palette "Bonus"
  52.     show window "Bonus" at -111,0
  53.   else
  54.     answer "Bien jouÄ ! vous avez gagnÄ le SUPER MâGA BONUS." with "KÄsako ???"
  55.     palette "Bonus"
  56.     show window "Bonus" at -111,0
  57.     set cursor to watch
  58.     wait 1 seconds
  59.     play "sifflement"
  60.     answer "Alors, pas mal, hein ? Et c'est opÄrationnel !"&return&&return&&return&┬
  61.     "Ñ Cette palette reste affichÄe si vous ouvrez d'autres piles. Ñ" with "Bonus"
  62.     play "Hourra"
  63.   end if
  64. end mouseUp
  65. Ñ-Ñ-Ñ-Ñ BOUTON 2 : ╟Niveau sonore des alertes╚
  66. on mouseUp
  67.   beep
  68.   Son
  69.   beep
  70. end mouseUp
  71. Ñ-Ñ-Ñ-Ñ BOUTON 3 : ╟Taille de la section donnÄes╚
  72. on mouseUp
  73.   global gXCMDError
  74.   answer file "Choisissez le fichier, quel qu'il soit, dont vous dÄsirez connaitre la taille de la section des donnÄes (Data Fork) :"  --╞
  75.   put it into ro
  76.   if ro is empty then exit mouseUp
  77.   put fileDataSize(ro) into NumberOfBytes
  78.   if gXCMDError is not empty then
  79.     answer gXCMDError
  80.     exit mouseUp
  81.   end if
  82.   answer "La taille de la section donnÄes du fichier ╟ " & ro & " ╚ est de " && NumberOfBytes/1000┬ --╞
  83.   && " Ko.  (soit " && NumberOfBytes/1000000 && " Mo)." --╞
  84.   put empty into ro
  85. end mouseUp
  86. Ñ-Ñ-Ñ-Ñ BOUTON 4 : ╟âditer les scripts╚
  87. on mouseUp
  88.   global FileName,TtxtLimit,Ro,Index,Partition,theExtract
  89.   put No into Partition
  90.   put "" into advice
  91.   if the optionKey is down then
  92.     put yes into Partition
  93.     put ", avec partition automatique" into advice
  94.   end if
  95.   put "" into TtxtLimit
  96.   put "" into theExtract
  97.   set lockMessages to true
  98.   set lockRecent to true
  99.   hide Msg
  100.   push card
  101.   lock screen
  102.   go stack ("la pile ê Äditer" & advice)
  103.   if the result ¡ "" then
  104.     exit mouseUp
  105.   end if
  106.   set the cantAbort of this stack to true
  107.   put the short name of this stack into Ro -- the name of the target to edit
  108.   put ro into maxName
  109.   repeat with i = 31 down to 24
  110.     if the length of maxName = i then delete char i of maxName
  111.   end repeat
  112.   ask file "Enregistrer l'Ädition des scripts sous╔" with maxName & "'Scpt"
  113.   if the result ¡ "" then
  114.     pop cd
  115.     set the cantAbort of this stack to false
  116.     exit mouseUp
  117.   end if
  118.   put it into FileName
  119.   put 1 into Index
  120.   if Partition = yes then put validName(FileName) into FileName
  121.   open file FileName
  122.   set cursor to watch
  123.   put the time & " ╤ " & the long date &return ┬
  124.   &"╫ Document rÄalisÄ avec ╟ âditer les scripts ╚ - Version 2.1.2 par Roberto Minotti & Jean Patrick Wendt. ╫" ┬
  125.   & return & return & "Pour une parfaite lisibilitÄ de ce document, utilisez la " ┬
  126.   &"police Monaco 9 points." & return & return into theExtract
  127.   put the length of theExtract into TtxtLimit
  128.   write theExtract to file FileName
  129.   get the script of this stack
  130.   if it = "" then put "Pas de script de Pile" into it
  131.   put theLines(2) &&"SCRIPT DE PILE ╟ " & Ro &" ╚" & theLines(2) &return┬
  132.   & it & return into theExtract
  133.   mayWriteExtract
  134.   play "Boing"
  135.   play "Sifflement"
  136.   answer firstAnswer() with "Suffisant" or "Continuer"
  137.   if it is "Suffisant" then
  138.     close file FileName
  139.     pop cd
  140.     set the cantAbort of this stack to false
  141.     exit mouseUp
  142.   end if
  143.   put the number of bgs of this stack into N
  144.   repeat with i = 1 to N
  145.     go bg i
  146.     getAllScripts FOND,"bg",i
  147.     put theLines(8) &return &return into theExtract
  148.     mayWriteExtract
  149.   end repeat
  150.   put theLines(3) &"    This is the End, my only friend. - J.Morrison.     "┬
  151.   &theLines(3) into theExtract
  152.   mayWriteExtract
  153.   close file fileName
  154.   pop Cd
  155.   play "Sifflement"
  156.   play "Hourra"
  157.   answer lastAnswer() with "So good" -- ╞
  158.   set the cantAbort of this stack to false
  159.   put "" into fileName
  160.   put "" into theExtract
  161.   hide Msg
  162. end mouseUp
  163. on getAllScripts fOwner,owner,p
  164.   scanScripts fOwner,owner,p
  165.   put theLines(4) &return into theExtract
  166.   mayWriteExtract
  167.   repeat with k = 1 to number of cds of this bg
  168.     go cd (k) of this bg
  169.     put the number of this cd into NumCd
  170.     scanScripts CARTE,"cd",NumCd
  171.   end repeat
  172. end getAllScripts
  173. on scanScripts fOwner,owner,p
  174.   global EmptyList,fileName,theExtract
  175.   put return & theLines(2) && fOwner&& p &&"╟"&(the short name of (owner && p))┬
  176.   &"╚"&& theLines(2) &return into theExtract
  177.   mayWriteExtract
  178.   if script of (owner && p) = "" then
  179.     put "╫ " &fOwner&&"╟"& the short name of (owner && p) & "╚╫" after emptyList
  180.   else
  181.     put return & theLines(2) && "SCRIPT DE " & fOwner && p ┬
  182.     & return & script of (owner&&p) & return into theExtract
  183.     mayWriteExtract
  184.   end if
  185.   if the number of (owner && flds) ¡ 0 then
  186.     put theLines(2) && "LES CHAMPS DE " & fOwner & return into theExtract
  187.     mayWriteExtract
  188.     repeat with j = 1 to number of (owner &&flds)
  189.       set cursor to busy
  190.       getObjScript fOwner,owner,CHAMP,Chp,"fld",j
  191.     end repeat
  192.   end if
  193.   if the number of (owner && btns) ¡ 0 then
  194.     put return &theLines(2) && "LES BOUTONS DE " & fOwner┬
  195.     & return into theExtract
  196.     mayWriteExtract
  197.     repeat with j = 1 to number of (owner &&btns)
  198.       set cursor to busy
  199.       getObjScript fOwner,owner,BOUTON,Btn,"btn",j
  200.     end repeat
  201.   end if
  202.   if EmptyList ¡ "" then
  203.     put return & "╫╫ Objet(s) dans"&&fOwner&&p&&"sans script : "┬
  204.     & EmptyList &return into theExtract
  205.     mayWriteExtract
  206.     put "" into EmptyList
  207.   end if
  208. end scanScripts
  209. on getObjScript fOwner,owner,fObj,shortObj,obj,j
  210.   global EmptyList,FileName,theExtract
  211.   get script of (owner && obj && j)
  212.   if it = "" or the number of words of it <5 then
  213.     put "╫ " &shortObj&&"╟"& the short name of (owner && obj && j) & "╚╫" after EmptyList
  214.     exit getObjScript
  215.   else put theLines(1) && fObj && j &" : ╟"& the short name of┬
  216.   (owner && obj && j) &"╚" & return & it & return into theExtract
  217.   mayWriteExtract
  218. end getObjScript
  219. on mayWriteExtract
  220.   global TtxtLimit, FileName,Partition,theExtract
  221.   set cursor to watch
  222.   put the length of theExtract into extractLength
  223.   add extractLength to TtxtLimit
  224.   if Partition = yes then
  225.     if TtxtLimit >31000 then
  226.       put extractLength-(TtxtLimit-31000) into cutChar
  227.       put char 1 to (cutChar) of theExtract into part1
  228.       get the number of lines of part1
  229.       put line 1 to (it-1) of theExtract into part1
  230.       put line (it) to (the number of lines of theExtract) of theExtract into part2
  231.       put part1 into theExtract
  232.       repeat with j =(number of lines of part1) down to 1
  233.         set cursor to busy
  234.         if word 1 of line j of part1 = "on" then
  235.           put line 1 to j-1 of part1 into theExtract
  236.           put line j to (the number of lines of part1)┬
  237.           of part1 before part2
  238.           exit repeat
  239.         end if
  240.       end repeat
  241.       write theExtract to file FileName
  242.       put part2 into theExtract
  243.       createNewFile
  244.       write theExtract to file FileName
  245.       put (the length of part2) + 60 into TtxtLimit
  246.     else if theExtract ¡ "" then write theExtract to file FileName
  247.     put "" into theExtract
  248.   end if
  249.   if theExtract ¡ "" then write theExtract to file FileName
  250.   put "" into theExtract
  251. end mayWriteExtract
  252. on createNewFile
  253.   global Filename,Index,Ro
  254.   set cursor to watch
  255.   close file FileName
  256.   add 1 to Index
  257.   if Index >99 then
  258.     beep 2
  259.     answer "Les scripts de la pile ╟"&Ro&"╚ dÄjê rÄcupÄrÄs, reprÄsentent 3 Mo de texte "┬
  260.     &"enregistrÄs sur 99 fichiers." &return&return& "C'est le nombre maximum de partitions "┬
  261.     &"autorisÄes par le programme ╔" with DÄsolÄ
  262.     pop cd
  263.     set the cantAbort of this stack to false
  264.     exit to HyperCard
  265.   end if
  266.   put Index into last word of FileName
  267.   open file FileName
  268.   write "Suite "& Index &" des scripts de " & Ro &return&return to file FileName
  269. end createNewFile
  270. function validName temp
  271.   repeat with i = (the length of temp) down to 1
  272.     if char i of temp ¡ ":" then
  273.       put char i of temp before itsName
  274.     else exit repeat
  275.   end repeat
  276.   put length(itsName) - 28 into K
  277.   if K >0 then
  278.     repeat K
  279.       delete last char of temp
  280.     end repeat
  281.   end if
  282.   put " 1" after last word of temp
  283.   return temp
  284. end validName
  285. function firstAnswer
  286.   global Ro,Index,TtxtLimit,Partition
  287.   put (round(TtxtLimit /102.4))/10 into PTxt
  288.   put " Ñ Le script de la pile ╟ "& Ro &" ╚ est ÄditÄ Ñ" &return into theAnswer
  289.   if Partition = No then
  290.     put "Il fait " & Ptxt & " Ko."&return& "╫ SimpleText est limitÄ ê 31 Ko ; "┬
  291.     &"pour une partition automatique, recommencez avec la touche Option." & return &return after theAnswer
  292.   else put " Il se trouve sur " &Index& " fichier(s)"┬
  293.   &" Äditable(s) par SimpleText." & return & return after theAnswer
  294.   put "Ñ Voulez-vous Äditer la TOTALITâ de la pile ?" after theAnswer
  295.   put the length of TheAnswer -- mise au point
  296.   return theAnswer
  297. end firstAnswer
  298. function lastAnswer
  299.   global Ro,Index,TtxtLimit,Partition
  300.   put (round(TtxtLimit /102.4))/10 into PTxt
  301.   put " L'Ädition de tous les scripts de la pile ╟" &Ro ┬
  302.   &"╚ est terminÄe." & return into theAnswer
  303.   if Partition = No then
  304.     put "Ñ Le fichier contient " &PTxt&" Ko de texte ; SimpleText "┬
  305.     &"ne peut ouvrir plus de 31 Ko."& return& "Ñ Pour partitionner, "┬
  306.     &"recommencez avec la touche Option enfoncÄe."after theAnswer
  307.   else
  308.     if index = 1 then
  309.       put return&"Ñ Son fichier de "&PTxt& " Ko de texte "┬
  310.       &"est directement Äditable par SimpleText." after theAnswer
  311.     else put return&"Ñ Elle est rÄpartie sur "&index&" fichiers "┬
  312.     &"directement Äditables par SimpleText." after theAnswer
  313.   end if
  314.   put the length of TheAnswer -- mise au point
  315.   return theAnswer
  316. end lastAnswer
  317. function theLines Q
  318.   repeat Q
  319.     put "Ñ-Ñ-Ñ-Ñ-" after bullets
  320.   end repeat
  321.   delete last char of bullets
  322.   return bullets
  323. end theLines
  324. Ñ-Ñ-Ñ-Ñ BOUTON 5 : ╟card button id 9╚
  325. on mouseup
  326.   play "1" with loop
  327.   go card "deux"
  328. end mouseup
  329.  
  330. ╫╫ Objet(s) dans CARTE 1 sans script : ╫ CARTE ╟un╚╫╫ Chp ╟card field id 8╚╫
  331.  
  332. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ CARTE 2 ╟deux╚ Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ
  333. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ LES CHAMPS DE CARTE
  334. Ñ-Ñ-Ñ-Ñ CHAMP 1 : ╟card field id 1╚
  335. on mouseUp
  336.   play "1"
  337.   go card "un"
  338. end mouseUp
  339.  
  340.  
  341. ╫╫ Objet(s) dans CARTE 2 sans script : ╫ CARTE ╟deux╚╫
  342. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ
  343.  
  344. Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ    This is the End, my only friend. - J.Morrison.     Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ-Ñ